package com.kitbox.hl.meshow.openid.oauth2.userdetails.Impl;

import com.kitbox.hl.meshow.openid.oauth2.userdetails.MyUserDetailsService;
import com.kitbox.hl.meshow.openid.oauth2.userdetails.model.UserInfo;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @author: honglei
 * @Date: 2019/7/16 10:44
 * @Version: 1.0
 * @See:
 * @Description:  代理类
 */
public class UserDetialProxyServiceImpl  implements MyUserDetailsService {
    private MyUserDetailsService myUserDetailsService;

    public UserDetialProxyServiceImpl(MyUserDetailsService myUserDetailsService) {
        this.myUserDetailsService = myUserDetailsService;
    }

    @Override
    public UserInfo getUserByUsername(String username) {
        return myUserDetailsService.getUserByUsername(username);
    }

    @Override
    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
        return myUserDetailsService.loadUserByUsername(s);
    }
}
